package com.yunsom.testdemo.design.factory;

/**
 * @author Xbao
 * @version 1.0
 * @description 工厂模式
 * @date 2021/3/9 17:12
 */
public class FactoryTest {

  public static void main(String[] args) {

    ShapeFactory shapeFactory = new ShapeFactory();
    Shape shape1 = shapeFactory.getShape("circle");
    shape1.draw();

    Shape shape2 = shapeFactory.getShape("triangle");
    shape2.draw();

    Shape shape3 = shapeFactory.getShape("squre");
    shape3.draw();

  }
}
